package dryven.model.di;

import java.lang.reflect.Method;

import dryven.reflection.DeclaringMethodIterator;

public abstract class AbstractDependencyService implements DependencyService {

	public AbstractDependencyService() {
		super();
	}

	@Override
	public void injectDependencies(LocalThreadStorage storage, Object o) {
		Class<?> clazz = o.getClass();
		final String methodName = "injectDependencies";
		for (Method m : new DeclaringMethodIterator(clazz)) {
			if(m.getName().equals(methodName)) {
				invokeMethod(storage, m, o, null);
			}
		}
	}

}